package com.galaxy.service.config;

import com.galaxy.commom.base.constant.GalaxyConstants;
import org.mybatis.spring.mapper.MapperScannerConfigurer;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * MybatisMapper扫描配置
 * @author caijinbang
 * @date 2018/10/27 17:21
 */

@Configuration
@AutoConfigureAfter(MybatisPlusConfig.class)
public class MyBatisMapperScannerConfig {

  @Bean
  public MapperScannerConfigurer mapperScannerConfigurer(){
    MapperScannerConfigurer mapperScannerConfigurer = new MapperScannerConfigurer();
    mapperScannerConfigurer.setSqlSessionFactoryBeanName("sqlSessionFactory");
    mapperScannerConfigurer.setBasePackage(GalaxyConstants.MAPPER_PACKAGE);
    return mapperScannerConfigurer;
  }
}
